home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / ANIM.SWG / 0004_FLC.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-03  |  8KB  |  202 lines

  1. --------a-FLC-------------------------------
  2.  
  3. The  Animator  Pro  animation file is  a  good  example of a hierarchial
  4. chunked  file  structure. The data in  an  animation file is arranged as
  5. follows:
  6.  
  7.      animation file:
  8.           optional prefix chunk:
  9.                settings chunk
  10.                cel placement chunk
  11.           frame 1 chunk:
  12.                postage stamp chunk:
  13.                     postage stamp data
  14.                color palette chunk
  15.                pixel data chunk
  16.           frame 2 chunk:
  17.                pixel data chunk
  18.           frame 3 chunk:
  19.                color palette chunk
  20.                pixel data chunk
  21.           frame 4 chunk:
  22.                color palette chunk
  23.           ring frame chunk:
  24.                color palette chunk
  25.                pixel data chunk
  26.  
  27.  
  28. FLC - Animator Pro Flic Files
  29.  
  30. This is the main animation file format created by Animator Pro. The file
  31. contains  a  128-byte  header,  followed  by  an  optional prefix chunk,
  32. followed by one or more frame chunks.
  33.  
  34. The   prefix   chunk,  if  present,   contains   Animator  Pro  settings
  35. information, CEL placement information, and other auxiliary data.
  36.  
  37. A  frame  chunk exists for each frame  in  the animation. In addition, a
  38. ring  frame follows all the animation  frames. Each frame chunk contains
  39. color palette information and/or pixel data.
  40.  
  41. The  ring  frame contains delta-compressed  information to loop from the
  42. last  frame of the flic back to the first. It can be helpful to think of
  43. the  ring frame as a copy of  the first frame, compressed in a different
  44. way.  All flic files will contain a ring frame, including a single-frame
  45. flic.
  46.  
  47.  
  48. The FLC file header
  49.  
  50. A  FLC file begins with a  128-byte header, described below. All lengths
  51. and  offsets  are in bytes. All values  stored  in the header fields are
  52. unsigned.
  53.  
  54. Offset  Length  Name         Description
  55.  
  56.   0       4     size         The size of the entire animation file,
  57.                              including this file header.
  58.  
  59.   4       2     magic        File format identifier. Always hex AF12.
  60.  
  61.   6       2     frames       Number of frames in the flic.  This
  62.                              count does not include the ring frame.
  63.                              FLC files have a maximum length of 4000
  64.                              frames.
  65.  
  66.   8       2     width        Screen width in pixels.
  67.  
  68.   10      2     height       Screen height in pixels.
  69.  
  70.   12      2     depth        Bits per pixel (always 8).
  71.  
  72.   14      2     flags        Set to hex 0003 after ring frame is
  73.                              written and flic header is updated.
  74.                              This indicates that the file was properly
  75.                              finished and closed.
  76.  
  77.   16      4     speed        Number of milliseconds to delay between
  78.                              each frame during playback.
  79.  
  80.   20      2     reserved     Unused word, set to 0.
  81.  
  82.   22      4     created      The MSDOS-formatted date and time of the
  83.                              file's creation.
  84.  
  85.   26      4     creator      The serial number of the Animator Pro
  86.                              program used to create the file.  If the
  87.                              file was created by some other program
  88.                              using the FlicLib development kit, this
  89.                              value is hex 464C4942 ("FLIB").
  90.  
  91.   30      4     updated      The MSDOS-formatted date and time of the
  92.                              file's most recent update.
  93.  
  94.   34      4     updater      Indicates who last updated the file.  See
  95.                              the description of creator.
  96.  
  97.   38      2     aspectx      The x-axis aspect ratio at which the file
  98.                              was created.
  99.  
  100.   40      2     aspecty      The y-axis aspect ratio at which the file
  101.                              was created. Most often, the x:y aspect ratio
  102.                              will be 1:1.  A 320x200 flic has a ratio of
  103.                              6:5.
  104.  
  105.   42      38    reserved     Unused space, set to zeroes.
  106.  
  107.   80      4     oframe1      Offset from the beginning of the file to the
  108.                              first animation frame chunk.
  109.  
  110.   84      4     oframe2      Offset from the beginning of the file to
  111.                              the second animation frame chunk.  This value
  112.                              is used when looping from the ring frame back
  113.                              to the second frame during playback.
  114.  
  115.   88      40    reserved     Unused space, set to zeroes.
  116.  
  117.  
  118. The FLC prefix chunk
  119.  
  120. An  optional  prefix  chunk may  immediately  follow  the animation file
  121. header. This chunk is used to store auxiliary data which is not directly
  122. involved  in  the  animation playback. The  prefix  chunk  starts with a
  123. 16-byte header (identical in structure to a frame header), as follows:
  124.  
  125. Offset  Length  Name         Description
  126.  
  127.   0       4     size         The size of the prefix chunk, including
  128.                              this header and all subordinate chunks
  129.                              that follow.
  130.  
  131.   4       2     type         Prefix chunk identifier. Always hex F100.
  132.  
  133.   6       2     chunks       Number of subordinate chunks in the
  134.                              prefix chunk.
  135.  
  136.   8       8     reserved     Unused space, set to zeroes.
  137.  
  138. To  determine whether a prefix chunk is present, read the 16-byte header
  139. following  the file header. If the type value is hex F100, it's a prefix
  140. chunk.  If  the  value is hex F1FA  it's  the  first frame chunk, and no
  141. prefix chunk exists.
  142.  
  143. ....
  144.  
  145. The FLC frame chunks
  146.  
  147. Frame chunks contain the pixel and color data for the animation. A frame
  148. chunk  may  contain  multiple  subordinate  chunks,  each  containing  a
  149. different  type  of data for the  current frame. Each frame chunk starts
  150. with a 16-byte header that describes the contents of the frame:
  151.  
  152. Offset  Length  Name         Description
  153.  
  154.   0       4     size         The size of the frame chunk, including this
  155.                              header and all subordinate chunks that follow.
  156.  
  157.   4       2     type         Frame chunk identifier. Always hex F1FA.
  158.  
  159.   6       2     chunks       Number of subordinate chunks in the
  160.                              frame chunk.
  161.  
  162.   8       8     reserved     Unused space, set to zeroes.
  163.  
  164.  
  165. Immediately  following the frame header are the frame's subordinate data
  166. chunks.  When the chunks count in the frame header is zero, it indicates
  167. that this frame is identical to the previous frame. This implies that no
  168. change is made to the screen or color palette, but the appropriate delay
  169. is still inserted during playback.
  170.  
  171. Each data chunk within a frame chunk is formatted as follows:
  172.  
  173. Offset  Length  Name         Description
  174.  
  175.   0       4     size         The size of the chunk, including this header.
  176.  
  177.   4       2     type         Data type identifier.
  178.  
  179.   6    (size-6) data         The color or pixel data.
  180.  
  181.  
  182. The type values in the chunk headers indicate what type of graphics data
  183. the  chunk contains and which compression  method was used to encode the
  184. data.  The  following values (and  their  associated mnemonic names) are
  185. currently found in frame data chunks:
  186.  
  187. Value     Name        Description
  188.  
  189.   4    FLI_COLOR256   256-level color palette info
  190.   7    FLI_SS2        Word-oriented delta compression
  191.   11   FLI_COLOR      64-level color palette info
  192.   12   FLI_LC         Byte-oriented delta compression
  193.   13   FLI_BLACK      Entire frame is color index 0
  194.   15   FLI_BRUN       Byte run length compression
  195.   16   FLI_COPY       No compression
  196.   18   FLI_PSTAMP     Postage stamp sized image
  197.  
  198. EXTENSION:FLC
  199. OCCURENCES:PC
  200. PROGRAMS:Autodesk Animator, Autodesk Animator Pro
  201. SEE ALSO:FLIc,FLT,CEL,COL
  202.